{extend name="common@admin/main" /}
{block name="content"}
    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <a href="" data-toggle="tooltip" title="新增" class="btn btn-primary">
                        <i class="fa fa-plus"></i>
                    </a>

                    <button type="button" data-toggle="tooltip" title="删除" class="btn btn-danger" onclick="confirm('确认？') ? $('#form-list').submit() : false;">
                        <i class="fa fa-trash-o"></i>
                    </button>
                </div>
                <h1>管理员</h1>
                <ul class="breadcrumb">
                    <li>
                        <a href="">首页</a>
                    </li>
                    <li>
                        <a href="#">管理员列表</a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        <i class="fa fa-list"></i>
                        管理员列表
                    </h3>
                </div>
                <div class="panel-body">
                    <form action="" method="get">
                        <div class="well">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="form-group">
                                        <label class="control-label" for="input-keyword">关键字</label>
                                        <input name="keyword" value="" placeholder="品牌名称" id="input-keyword" class="form-control" type="text">
                                    </div>
                                </div>
                            </div>
                            <div class="row"><!-- div.row>div.col-sm-12 -->
                                <div class="col-sm-12">
                                    <button type="submit" id="button-filter" class="btn btn-primary pull-right">
                                        <i class="fa fa-search"></i>
                                        筛选
                                    </button>
                                </div>
                            </div>
                        </div>
                    </form>

                    <form action="" method="post" enctype="multipart/form-data" id="form-list">
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <td style="width: 1px;" class="text-center">
                                        <input type="checkbox"/>
                                    </td>

                                    <td class="text-left">
                                        <a href="" class="">ID</a>
                                    </td>
                                    <td class="text-left">
                                        <a href="" class="">用户名</a>
                                    </td>
                                    <td class="text-left">
                                        <a href="" class="">邮箱</a>
                                    </td>
                                    <td class="text-left">
                                        <a href="javascript:;" class="">密码</a>
                                    </td>
                                    <td class="text-left">
                                        <a href="javascript:;" class="">盐</a>
                                    </td>


                                    <td class="text-right">操作</td>
                                </tr>
                                </thead>
                                <tbody class="tbodys">


                                </tbody>
                            </table>
                        </div>
                    </form>

                    <div class="row">

                    </div>
                </div>
            </div>
        </div>
    </div>
{/block}
{block name="title"}
<title>用户列表</title>
{/block}

{block name="appendJS"}
<script>
    $(function(){
        var userlist={$user},
            i=1;
        console.log(userlist)
        $.each(userlist,function(key,val){
            tr=$('<tr/>');
            tr.append(
                    $('<td/>',{class:"text-left"}).html(i++)
            );
            tr.append(
                 $('<td/>',{class:"text-left"}).html(val.id)
            );
            tr.append(
                 $('<td/>',{class:"text-left"}).html(val.username)
            );
            tr.append(
                 $('<td/>',{class:"text-left"}).html(val.email)
            );
            tr.append(
                 $('<td/>',{class:"text-left"}).html(val.password)
            );
            tr.append(
                 $('<td/>',{class:"text-left"}).html(val.password_salt)
            );
            tr.append(
                 $('<td/>',{class:"text-left"}).append(
                    $('<a/>',{
                               class:"btn btn-primary",
                               title:"编辑",
                               // data-toggle:"tooltip"
                               href:"/admin/permiss/updateroleaccess.html?id="+val.id
                           }).append($('<i/>',{class:"fa fa-pencil"}))
                 )
            );
            $('.tbodys').append(tr);
        });
    })
</script>
<script type="text/javascript" src="/static/admin/js/userlist.js"></script>
{/block}
